import request from '@/utils/request'
// 课程目标达成度 
export const Achievement_Of_Course_Objectives = (subid, data) => {
    let A='A'
    return request.post(`/exam/auto_produce_prase_xlsx/create?subId=${subid}&paperType=${A}`, data)
}
// 自动组卷
export const makePaperRandomly_api = (Id) => {
    return request.post(`/exam/auto_produce_paper/create?id=${Id}`)
    // return request.get(`/exam/T_exam_paper/topic/getPaperCompleteInfo/${Id}`, Id)
}
// 试卷换题
export const switch_item_in_paper = (Id, questionId, paperId) => {
    return request.put(`/exam/T_exam_paper/topic/exchange?id=${Id}&paperId=${paperId}&questionId=${questionId}`)
}
//获取全部试卷信息
// get的数据有下划线，post，put没有下划线，删除只用传ID
export const GetpaperList = (ASCId,paperType) => {
    // console.log('kzy', subId);
    return request.get(`/exam/T_Allexam_desc/list?ASCId=${ASCId}&paperType=${paperType}`)
}
// 试卷发布
export const addPaper = (data) => request.post('/exam/T_exam_paper/create', data)
//更新试卷
export const editPaper = (paperData) => {
    // console.log("paperData", paperData);
    // console.log("paperData.id", paperData.id);
    return request.put(`/exam/T_exam_paper/update/?id=${paperData.id}`, paperData)
}
// 删除试卷
export const delPaper = (id) => request.delete(`/exam/T_exam_paper/delete/?id=${id}`)
// , { params: { id } }
//获取试卷标头详情
export const GetDetailPaper = (paperId) => {
    // return request.get('/papericle/info', {
    //     params: {
    //         id
    //     }
    // })
    return request.get(`/exam/T_exam_desc/concrete?Id=${paperId}`, paperId)
}


// 根据题库组卷
// 获取试卷试题详情
export const PaperGetItemDetail = (paperId) => {
    return request.get(`exam/T_exam_paper/topic/list?paperId=${paperId}`, paperId)
}

//题库选择题目点击确认选择后发送题目ID和试卷ID
export const AddItemToPaper = (data) => {
    return request.post('exam/T_exam_paper/topic/create', data)
}

// 批量删除试题（已经添加到试卷里的题）
export const delItemsInPaper = (data) => {

    return request.post('/exam/T_exam_paper/topic/delete', data)
}
// 试卷导出获取试卷完整信息
export const GetPaperCompleteInfo = (Id,ACSId) => {
    // return request.get(`/exam/T_exam_desc/concrete?Id=${paperId}`, paperId)

    return request.get(`/exam/T_exam_paper/topic/getPaperCompleteInfo?id=${Id}&ACSId=${ACSId}`)
} 